<?php

namespace Kollway\Logger\Middleware;

use Kollway\Logger\Services\LoggerService;

class CatchResponseMiddleware
{
    public function handle($request, \Closure $next)
    {
        $response = $next($request);

        // 记录请求响应内容
        LoggerService::log($request, $response);

        return $response;
    }
}